#ifndef DICTIONARYMANAGERAPI_H
#define DICTIONARYMANAGERAPI_H

#include "Entity/DictData.h"
#include "Entity/DictType.h"
#include <QObject>
#include <QMainWindow>
#include <QtNetwork>
#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <Utils.h>
#include <config.h>
#include <QMessageBox>



class DictionaryManagerApi : public QObject
{
    Q_OBJECT
public:
    explicit DictionaryManagerApi(QObject *parent = nullptr);

    //查询参数列表
    QByteArray* getList(int pageNum,int pageSize,QString dictName = "",
                     QString dictType = "",QString status = "",
                     QString beginTime = "",QString endTime = "");
    QByteArray *editDict(qlonglong id,DictType &dict);
    QByteArray *deleteItems(QString ids);
    QByteArray *getById(qlonglong id);
    QByteArray *refreshCache();
    QByteArray *getOptionList();
    QByteArray *getDictDataList(int pageNum,int pageSize,QString dictType = "",
                                QString status = "",QString dictLabel = "");
    QByteArray *editDictData(qlonglong id,DictData &dict);
    QByteArray *deleteDictDataItems(QString ids);
    QByteArray *getDictDataById(qlonglong id);

signals:

private:
    QString baseUrl ;
    QNetworkRequest request;
    QNetworkAccessManager *manager ;
    QByteArray *data = nullptr;
    Utils utils;
};

#endif // DICTIONARYMANAGERAPI_H
